package part1.oo.ooday05.ooday05test;

public class StaticFinalDemo {
    public static void main(String[] args) {
        System.out.println(Aoo.PI);
        //Aoo.PI = 3.1415926; //常量不能被改变

        //加载Aoo.class到方法区
        //同时静态变量num一并存储到方法区
        //从方法区中获取num并输出
        System.out.println(Aoo.num);
        
        //编译期在编译时就会把常量替换成具体的数 效率高
        System.out.println(Aoo.COUNT);
    }
}


class Aoo{
    public static int num = 5;
    public static final int COUNT =5;

    public static final double PI = 3.1415926;
    //public static final int Num; //编译错误 常量必须声明同时初始化
}